package com.escope.casemanager.controller;

import com.escope.casemanager.model.HttpResult;
import com.escope.casemanager.service.SysParamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 系统参数接口
 * 2024/3/15
 */
@RestController
@RequestMapping("sysparam")
@CrossOrigin
@Api(value = "系统参数接口", tags = {"系统参数接口"})
public class SysParamController {
    @Autowired
    private SysParamService sysParamService;

    @PostMapping(value = "/paramTypeAll")
    @ApiOperation("查询全部参数类型")
    public HttpResult paramTypeAll() {
        return HttpResult.ok(sysParamService.findParamTypeAll());
    }

    @PostMapping(value = "/paramByTypeCode")
    @ApiOperation("根据参数类型获取参数列表")
    public HttpResult paramByTypeCode(String typeCode) {
        return HttpResult.ok(sysParamService.findParamByTypeCode(typeCode));
    }
}
